import {
  verifyJSX,
  verifyFlag,
  verifyReceivedData,
} from "react-native-css-interop/doctor";

export function verifyInstallation() {
  if (!verifyJSX()) {
    throw new Error(
      "jsxImportSource was not set to 'nativewind'. Please refer to http://nativewind.dev/troubleshooting#jsxImportSource",
    );
  }

  if (!verifyReceivedData()) {
    throw new Error(
      "Nativewind received no data. Please refer to http://nativewind.dev/troubleshooting#no-data",
    );
  }

  if (!verifyFlag("nativewind")) {
    throw new Error(
      "Nativewind: was unable to detect the 'nativewind/preset'. Please refer to http://nativewind.dev/troubleshooting#tailwind-preset",
    );
  }

  console.warn("NativeWind verifyInstallation() found no errors");
}
